package scu.maqiang.bes;

import scu.maqiang.mesh.Mesh;

public class BES {
	/**
	 * 抽像有限元构造函数
	 * 
	 * @param mesh 网格类
	 */
	public BES(Mesh mesh) {
		this.mesh = mesh;
		nE = mesh.getNb();
		nB = mesh.getNb();
		nDim = mesh.getnDim();
		nPerEle = mesh.getnPerElement();
		nPerBoundary = mesh.getnPerBoundary();
		nBand = 0;
		coordNode = null;
		coordRegion = new double[nPerEle][nDim];
		coordBoundary = new double[nPerBoundary][nDim];
	}
	
	public BES(Mesh mesh, int dofPerNode) {
		this(mesh);
		this.dofPerNode = dofPerNode;
		ndof = dofPerNode * mesh.getNb();
		dofPerElement = dofPerNode * nPerEle;
		dofPerBoundary = dofPerNode * nPerBoundary;
	}
	
	/**
	 * 有限元空间关联的网格
	 */
	public Mesh mesh;

	/**
	 * 自由度个数
	 */
	protected int ndof;

	/**
	 * 问题维数，等于网格维数
	 */
	protected int nDim;

	/**
	 * 每个单元结点数
	 */
	protected int nPerEle;

	/**
	 * 每个边界结点数
	 */
	protected int nPerBoundary;

	/**
	 * 每个结点自由度个数
	 */
	protected int dofPerNode;

	/**
	 * 单元个数
	 */
	protected int nE;

	/**
	 * 边界个数
	 */
	protected int nB;

	/**
	 * 每个单元自由度数
	 */
	protected int dofPerElement;

	/**
	 * 每个边界自由度数
	 */
	protected int dofPerBoundary;

	/**
	 * 形成的稀疏矩阵半带宽
	 */
	protected int nBand;
	
	/**
	 * 结点坐标数组
	 */
	double[] coordNode;

	/**
	 * 单元坐标数组
	 */
	double[][] coordRegion;

	/**
	 * 边界单元数组
	 */
	double[][] coordBoundary;
}
